import { connect,useDispatch,useSelector } from "react-redux";
import { useEffect,useState } from "react";
const Logo = (props:any) => {
	const {menuList}=props
	const [title, settitle] = useState<string>('首页');
	useEffect(() => {
		if (menuList && menuList.length > 0) {
			settitle(menuList[0].title);
		  }
	}, [menuList]);

console.log()
	return (
		<div className="logo-box">
			 <h2 className="logo-text">{title}</h2> 
		</div>
	);
};
const mapStateToProps = (state: any) => state.menu;
export default connect(mapStateToProps,null)(Logo);

